home *** CD-ROM | disk | FTP | other *** search
- Path: news.ust.hk!cs_lcm
- From: cs_lcm@ug.cs.ust.hk (Lee Chun Man Raymond)
- Newsgroups: comp.lang.c
- Subject: directories listing
- Date: 15 Jan 1996 04:16:58 GMT
- Organization: The Hong Kong University of Science and Technology
- Message-ID: <4dckfq$4um@news.ust.hk>
- NNTP-Posting-Host: csl3su39.cs.ust.hk
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- Hi,
-
- I wrote a C program that needs to print out a listing of
- sub-directories of current working directory.
-
- The following is part of my program : ( Turbo C++ )
-
- struct find_t current_file;
- int done;
- .........
- printf("Directories listing : \n");
- done = _dos_findfirst(full_path , FA_DIREC, ¤t_file);
- while (!done) {
- strcpy(file_path, path_name);
- strcat(file_path, "\\");
- strcat(file_path, current_file.name)
- printf("--> %s\n",file_path);
- done = _dos_findnext(¤t_file);
- }
-
- I don't know why it lists out all file including the sub-directories, but
- I only want to lists our those sub-directories.
-
- Would someone help me?
-
- Thank you for your attention,
-
- Raymond
- --
- _______________________________________
- ---------------------------------------|
- | Name : Lee Chun Man Raymond ||
- | Email: cs_lcm@stu.ust.hk ||
- | Computer Science Year 3 ||
- | Hong Kong University of ||
- | Science and Technology ||
- ---------------------------------------
-
-